<?php
class SP_Routing_RouteCollector
{
	protected static $routes=array();
	
	public static function setRoute($name, SP_Routing_Route $route)
	{
		self::$routes[$name]=$route;
	}
	
	public static function set($name,$uri,$module=null,$action=null,$validators=array())
	{
		$route = new SP_Routing_Route;
		$route->setUri($uri);
		$route->setModule($module);
		$route->setAction($action);
		$route->setValidators($validators);
		self::$routes[$name]=$route;
	}
	
	public static function has($name)
	{
		return array_key_exists($name, self::$routes);
	}
	
	public static function get($name)
	{
		return self::$routes[$name];
	}
	
	public static function getAll()
	{
		return self::$routes;
	}
	
	public static function clear()
	{
		self::$routes=array();
	}
	
	
}